package com.stylefeng.guns.modular.system.service.impl;

import com.stylefeng.guns.modular.small.util.ResponseResultDTO;
import com.stylefeng.guns.modular.system.model.ArtificerMeansType;
import com.stylefeng.guns.modular.system.dao.ArtificerMeansTypeMapper;
import com.stylefeng.guns.modular.system.service.IArtificerMeansTypeService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 分类与技师的中间表 服务实现类
 * </p>
 *
 * @author stylefeng
 * @since 2019-09-23
 */
@Service
@Slf4j
public class ArtificerMeansTypeServiceImpl extends ServiceImpl<ArtificerMeansTypeMapper, ArtificerMeansType> implements IArtificerMeansTypeService {

    @Resource
    private  ArtificerMeansTypeMapper  artificerMeansTypeMapper;

    @Override
    public Object searchListByArtId(Integer artId) {
        ResponseResultDTO resultDTO=new ResponseResultDTO();
        if(artId==null){
            resultDTO.setMsg("PARAM-NULL");
            resultDTO.setStatus("-1");
            return resultDTO;
        }
        try {
            List list=artificerMeansTypeMapper.searchListByArtId(artId);
            resultDTO.setData(list);
        }catch (Exception e){
            e.printStackTrace();
            log.info("服务器异常!");
            resultDTO.setMsg("系统异常");
            resultDTO.setStatus("-1");
        }
        return resultDTO;
    }

    /**
     * 删除 技师服务项目
     * @param artId
     * @param businessTypeId
     * @return
     * litong 20190925
     */
    @Override
    public Integer deleteArtMenu(Integer artId, Integer businessTypeId) {
        return artificerMeansTypeMapper.deleteArtMenu( artId,  businessTypeId) ;
    }
}
